<template>
  <div class="inform">
    <!-- <el-form class="announcement_nav" ref="dataForm" style="height:50px">
      <el-button style="float:left;margin-left:30px;" class="add" type="primary" size="medium">添加一条</el-button>
    </el-form> -->
    <el-table :data="tableData" border style="width: 100%">
      <el-table-column prop="title" align="center" label="公告主题" />
      <el-table-column prop="use" align="center" label="发布方" />
      <el-table-column prop="time" align="center" label="发布时间" />
      <el-table-column prop="couent" align="center" label="公告内容" />
      <el-table-column label="操作" align="center">
        <template slot-scope="scope">
          <!-- <el-button size="medium" type="success " >编辑</el-button> -->
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页 -->
    <el-col :span="24" class="toolbar" style="text-align: center;">
      <el-pagination
        background
        :current-page="currentPage"
        :page-count="pageNum"
        :page-size="pagesize"
        style="margin-top:30px;margin-bottom:30px"
        layout="total, prev, pager, next, jumper"
        :total="total"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />
    </el-col>
  </div>
</template>
<script>
export default {
  data() {
    return {
      currentPage: 1, // 初始页
      pagesize: 10, // 当前页面内的列表行数
      pageCount: 1,
      pageNum: 1, // 页数
      total: 2,
      tableData: [
        {
          title: '停水通知',
          use: '物业办',
          time: '2019-11-16 12:15:36',
          couent:
            '尊敬的业主:接收来自自来水公司对管道维修，将于今天下午18点———明天上午10点停水。望大家做好储水准备！'
        },
        {
          title: '停电通知',
          use: '物业办',
          time: '2019-12-15 11:30:56',
          couent:
            '尊敬的业主:接收来自电力公司对线路维修，将于今天下午14点———今天晚上22点停电。望大家做好准备！'
        }
      ]
    }
  },
  mounted() {},
  methods: {
    handleClick(row) {
      this.$router.push({ name: '系统通知管理', params: { data: row }})
    },
    // 当前页
    handleSizeChange: function(pagesize) {
      this.pagesize = pagesize
    },
    // 换页：更新列表数据
    handleCurrentChange: function(currentPage) {
      this.currentPage = currentPage
    }
  }
}
</script>
<style lang='scss' scoped>
.inform {
  margin-top: 55px;
}
</style>
